<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目管理信息编辑</title>
<link href="<%=request.getContextPath() %>/css/main.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath() %>/css/reset.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/scripts/My97DatePicker4/WdatePicker.js"></script>
<script src="<%=request.getContextPath()%>/scripts/submitcheck.js"></script>
<c:import url="/deptselectInner.jsp"></c:import>
<script src="<%=request.getContextPath()%>/scripts/jquery.form.js"></script>

<script type="text/javascript">

String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/g, "");
};

function bopt( k ){
	document.getElementById("opt").value = k ;
	
}

var f = null;

function check(formData, jqForm, options) {
	if (f.opt.value=='3'){
		f.rejectReason.value = f.rejectReason.value.trim();
		if (f.rejectReason.value==''){
			f.rejectReason.focus();
			alert("审核未通过时必须填写审核未通过意见");
			return false;
		}
	}

	if (f.proManageDepartShow.value == ''){
		alert("必须选择项目建设管理信息发布管理部门");
		return false;
	}

	if(f.proManageDepart.value.substring(8,9)<2){
		alert(f.proManageDepartShow.value+"不能选做审批部门，请选择具体的审批部门");
		return false;
	}
	
	return true;
};
</script>
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" <c:out value="${msg}" escapeXml="false" />>
<form id="form1" name="form1" method="post" action="<c:url value="/admin/saveProManageOpt/"/>" onsubmit="return false">
<%@include file="proForm.jsp"%>
<table align="center" width="100%" id="optbtn">
	<tr>
		<td align="center">
		<input type="hidden" id="newId" value="${projectManageInfo.proManageID}"/>
		<input type="hidden" id="opt" name="opt" /> 
		
		<c:if test="${show == 1}">
			<input type="submit" value="保  存" onclick="bopt(1)" class="bnt60" />
		</c:if>
		</td>
	</tr>
</table>
</form>

<script type="text/javascript">

window.onload=function (){

	f = document.getElementById("form1");

	var options={type:"POST", dataType:"json", beforeSubmit:check, success:resultResponse};
	$('#form1').ajaxForm(options);
}
</script>
</body>
</html>
